package edu.pku.sei.act.actools.util;

import android.util.Log;

public class CapabilityMap {
	String type;
	String taskID;
	String taskAbility;
	String providerID;
	String providerAbility;
	
	public CapabilityMap() {
		type = "null";
		taskID = "null";
		taskAbility = "null";
		providerID = "null";
		providerAbility = "null";
	}
	
	public CapabilityMap(String type, String taskID, String taskAbility, String providerID,
			String providerAbility) {
		super();
		this.type = type;
		this.taskID = taskID;
		this.taskAbility = taskAbility;
		this.providerID = providerID;
		this.providerAbility = providerAbility;
	}
	
	public CapabilityMap(Capability c1, Capability c2) {
		
		type = c1.getType();
		taskID = c1.getProviderID();
		taskAbility = c1.getAbilityName();
		providerID = c2.getProviderID();
		providerAbility = c2.getAbilityName();
	}

	public CapabilityMap(String envInfo) {
		
		String[] ss = envInfo.split(",");
		if (ss.length != 6){
			Log.e("CapabilityMap<init>","wrong envInfo:" + envInfo);
			return ;
		}
		type = ss[1];
		taskID = ss[2];
		taskAbility = ss[3];
		providerID = ss[4];
		providerAbility = ss[5];
	}
	
	public String toString(){
		return ACToolsNamingSpace.EnvInfo.CAPABILITY_MAP + "," + type+","+taskID+","+taskAbility+","+providerID+","+providerAbility;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getTaskID() {
		return taskID;
	}

	public void setTaskID(String taskID) {
		this.taskID = taskID;
	}

	public String getTaskAbility() {
		return taskAbility;
	}

	public void setTaskAbility(String taskAbility) {
		this.taskAbility = taskAbility;
	}

	public String getProviderID() {
		return providerID;
	}

	public void setProviderID(String providerID) {
		this.providerID = providerID;
	}

	public String getProviderAbility() {
		return providerAbility;
	}

	public void setProviderAbility(String providerAbility) {
		this.providerAbility = providerAbility;
	}
	
}
